
import styles from '../styles/Home.module.css'
import React from 'react';
import { message, Button } from 'antd';
import hello from '../controls/hello';



const MyCom=({data}) => {
  const info = () => {
    message.info('This is a normal message');
  };
  return (
    <div className={styles.container}>
      {
        data.map((t, i) => {
          return <div key={i}><p><Button type="primary" onClick={info}>{t.title}</Button></p></div>
        })
      }
    </div>
  )
}

export async function getServerSideProps() {  
  const data=hello();//[{title:'按钮1'},{title:'按钮2'}];
  return { props: { data } }
}

MyCom.displayName = "ShowMsgBox";
export default MyCom;